package cn.anc.aonicardv.net.download;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import javax.net.SocketFactory;

/**
 * Created by yangdai on 2017/12/29.
 */

public class WifiSocketFactroy extends SocketFactory {

    public static Socket socket;


    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    public Socket createSocket() {
        return socket;
    }

    @Override
    public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
        return new Socket(host, port);
    }

    @Override
    public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException {
        return new Socket(host, port, localHost, localPort);

    }

    @Override
    public Socket createSocket(InetAddress host, int port) throws IOException {
        return new Socket(host, port);
    }

    @Override
    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
        {
            return new Socket(address, port, localAddress, localPort);
        }
    }
}
